refactor: move inductive information in compiler from lazily filled local caches to eager persistent environment extensions#13882
Conversation
|
!bench |
|
Benchmark results for 52e598e against c47a0c7 are in. There are significant results. @Kha
No significant changes detected. |
|
Reference manual CI status:
|
|
!bench |
|
Benchmark results for a9515da against c47a0c7 are in. There are significant results. @Kha
Small changes (20✅, 4🟥) Too many entries to display here. View the full report on radar instead. |
|
Mathlib CI status (docs):
|
|
!bench |
|
Benchmark results for 79779f6 against c47a0c7 are in. There are significant results. @Kha
Large changes (1🟥)
Medium changes (1🟥)
Small changes (383✅, 45🟥) Too many entries to display here. View the full report on radar instead. |
This PR lets the compiler handle public types whose constructor field types are not available in importing modules — for example a public structure with a `private` field whose type is only privately imported. Compiling code that uses such a type in another module previously failed because the compiler tried to inspect field types it could not see. The LCNF representation information derived from constructor fields — trivial-structure info, mono and impure types, and constructor layouts — is now computed and persisted in each inductive's defining module and reused by importers instead of being recomputed there. Inductive types are compiled eagerly (`compileInductives`) from `compileDecls`, and the information is stored in `MapDeclarationExtension`s read by strict lookups.
|
!bench |
|
Benchmark results for 6d690ec against c47a0c7 are in. There are significant results. @Kha
Large changes (1🟥)
Medium changes (1🟥)
Small changes (383✅, 56🟥) Too many entries to display here. View the full report on radar instead. |
This is in preparation for - and already enables in part - correctly compiling code using public types with private constructors and thus potentially inaccessible type references. A follow-up PR will have to further restrict the trivial structure optimization, which is the only case where even this early analysis can still lead to dangling references.